﻿using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public struct SkillItem
{
    /// <summary> 技能名字</summary> 
    public string name;

    /// <summary> 触发类型</summary> 
    public SkillInvokeType invokeType;

    /// <summary> 触发按键</summary> 
    public List<KeyCode> hotKeys;

    /// <summary> 造成伤害的数值</summary> 
    public int damage;

    /// <summary> 参数1</summary> 
    public int param1;

    /// <summary> 硬直时间（无视按键输入）</summary> 
    public float frozenTime;

    /// <summary> 允许切换动画的时间</summary> 
    public float changeTime;

    /// <summary> 触发类型是连招才有意义。 是否是连招最后一个？ 如果是，触发该技能后会重新计算连招</summary> 
    public bool isLastComboItem;


    public SkillItem(string aaaa)
    {
        this.name = "";
        this.hotKeys = new List<KeyCode>();
        this.invokeType = SkillInvokeType.Normal;
        this.damage = 0;
        this.param1 = 0;
        this.frozenTime = 0F;
        this.changeTime = 0F;
        this.isLastComboItem = false;
    }
    public SkillItem(object a)
    {
        this.name = "";
        this.hotKeys = new List<KeyCode>();
        this.invokeType = SkillInvokeType.Normal;
        this.damage = 0;
        this.param1 = 0;
        this.frozenTime = 0F;
        this.changeTime = 0F;
        this.isLastComboItem = false;
    }
    public SkillItem(SkillItem aaaa)
    {
        this.name = "";
        this.hotKeys = new List<KeyCode>();
        this.invokeType = SkillInvokeType.Normal;
        this.damage = 0;
        this.param1 = 0;
        this.frozenTime = 0F;
        this.changeTime = 0F;
        this.isLastComboItem = false;
    }

    public override string ToString()
    {
        return string.Format("名字：{0} | 触发类型：{1} | 硬直时间：{2} | 切换时间：{3}",
            name, this.invokeType.ToString(), frozenTime, changeTime);
    }
}

public enum SkillInvokeType
{
    Normal,
    /// <summary> 连招触发</summary> 
    Combo,
    /// <summary> 同时按下触发</summary> 
    Both,
    /// <summary> 蓄力充能类型</summary> 
    Charge
}
